package com.insuremonitor.system.service.impl;

import com.insuremonitor.common.utils.DateUtils;
import com.insuremonitor.system.domain.FrontInsureType;
import com.insuremonitor.system.mapper.FrontInsureTypeMapper;
import com.insuremonitor.system.service.IFrontInsureTypeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 保险类型Service业务层处理
 * 
 * @author ruoyi
 * @date 2023-11-03
 */
@Service
public class FrontInsureTypeServiceImpl implements IFrontInsureTypeService 
{
    @Autowired
    private FrontInsureTypeMapper frontInsureTypeMapper;

    /**
     * 查询保险类型
     * 
     * @param insureTypeId 保险类型主键
     * @return 保险类型
     */
    @Override
    public FrontInsureType selectFrontInsureTypeByInsureTypeId(Long insureTypeId)
    {
        return frontInsureTypeMapper.selectFrontInsureTypeByInsureTypeId(insureTypeId);
    }

    /**
     * 查询保险类型列表
     * 
     * @param frontInsureType 保险类型
     * @return 保险类型
     */
    @Override
    public List<FrontInsureType> selectFrontInsureTypeList(FrontInsureType frontInsureType)
    {
        frontInsureType.setStatus("1");
        return frontInsureTypeMapper.selectFrontInsureTypeList(frontInsureType);
    }

    /**
     * 新增保险类型
     * 
     * @param frontInsureType 保险类型
     * @return 结果
     */
    @Override
    public int insertFrontInsureType(FrontInsureType frontInsureType)
    {
        frontInsureType.setCreateTime(DateUtils.getNowDate());
        return frontInsureTypeMapper.insertFrontInsureType(frontInsureType);
    }

    /**
     * 修改保险类型
     * 
     * @param frontInsureType 保险类型
     * @return 结果
     */
    @Override
    public int updateFrontInsureType(FrontInsureType frontInsureType)
    {
        frontInsureType.setUpdateTime(DateUtils.getNowDate());
        return frontInsureTypeMapper.updateFrontInsureType(frontInsureType);
    }

    /**
     * 批量删除保险类型
     * 
     * @param insureTypeIds 需要删除的保险类型主键
     * @return 结果
     */
    @Override
    public int deleteFrontInsureTypeByInsureTypeIds(Long[] insureTypeIds)
    {
        return frontInsureTypeMapper.deleteFrontInsureTypeByInsureTypeIds(insureTypeIds);
    }

    /**
     * 删除保险类型信息
     * 
     * @param insureTypeId 保险类型主键
     * @return 结果
     */
    @Override
    public int deleteFrontInsureTypeByInsureTypeId(Long insureTypeId)
    {
        return frontInsureTypeMapper.deleteFrontInsureTypeByInsureTypeId(insureTypeId);
    }
}
